
import wx
import os, sys

class MyFrame(wx.Frame):
    def __init__(self,parent, id, title):
        wx.Frame.__init__(self,parent,id,title)
        self.CreateStatusBar()
        menuBar = wx.MenuBar()
        menu = wx.Menu()
        menu.Append(99, '&Message Dialog', 'Shows a Message Dialog')
        menu.Append(100, '&Color Dialog', 'Shows a Color Dialog')
        menu.Append(101, '&File Dialog', 'Shows a File Dialog')
        menu.Append(102, '&Page Setup Dialog', 'Show a Page Setup Dialog')
        menu.Append(103, '&font Dialog', 'Show a Font Dialog')
        menu.Append(104, '&Directory Directory', 'Shows a Directory Dialog')
        menu.Append(105, '&TextEntry Dialog', 'Shows a Textentry Dialog')
        menuBar.Append(menu, '&Dialog')
        self.SetMenuBar(menuBar)
        self.Bind(wx.EVT_MENU, self.messgae, id=99)
        self.Bind(wx.EVT_MENU, self.choosecolor, id=100)
        self.Bind(wx.EVT_MENU, self.openfile, id=101)
        self.Bind(wx.EVT_MENU, self.pagesetup, id=102)
        self.Bind(wx.EVT_MENU, self.choosefont, id=103)
        self.Bind(wx.EVT_MENU, self.opendir, id=104)
        self.Bind(wx.EVT_MENU, self.singlechoice, id=105)
        self.Bind(wx.EVT_MENU, self.textentry, id=106)
    def messgae(self, event):
        dlg = wx.MessageDialog(self, 'To save one life is as is.', \
                'Talmud', wx.OK | wx.ICON_INFORMATION)
        dlg.ShowModal()
        dlg.Destroy()
    def choosecolor(self, event):
        dlg = wx.ColourDialog(self)
        dlg.GetColourData().SetChooseFull(True)
        if dlg.ShowModal() == wx.ID_OK:
            data = dlg.GetColourData()
            self.SetStatusText('You selected: %s\n' % \
                    str(data.GetColour().Get()))
            dlg.Destroy()

class MyApp(wx.App):
    def OnInit(self):
        myframe = MyFrame(None, -1, 'commondialogs.py')
        myframe.CenterOnScreen()
        myframe.Show(True)
        return True
app = MyApp()
app.MainLoop()
